<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>标题</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <style>
        .addCss{
            border: 1px orange solid;
        }
    </style>
</head>
<body>
    <div id="root">
    </div>
        <button id="btn">点击生成输入框</button>
    
    <script type="text/javascript">
       const btn = document.getElementById('btn')
       
       btn.onclick = ()=>{
           const input = document.createElement('input')
           input.className='addCss'
           input.onclick=()=>{
               alert('1')
           }
           
        //    input.parentElement.style.backgroundColor = ('skyblue')
           document.body.appendChild(input)
           input.focus()
          
           console.log(input.parentElement)
       }
    </script>
</body>
    <script type="text/javascript">
        Vue.config.productionTip = false

        new Vue({
            el:'#root',
            data:{
              
            },
            computed:{
            //计算方法
            
            },
            methods:{
            //方法
            
            },
            filters:{
            //过滤器
            
            },
            directives:{
                newInput(element,binding){
                   const input = document.createElement('input')
                   document.body.appendChild(input)
                }
            }
        })
        </script>
    </html>
